package com.jeesite.modules.dp.entity.orderdetail;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size;
import javax.validation.constraints.NotNull;

import com.jeesite.common.entity.DataEntity;
import com.jeesite.common.mybatis.annotation.Column;
import com.jeesite.common.mybatis.annotation.Table;
import com.jeesite.common.mybatis.mapper.query.QueryType;

/**
 * dp_orderdetailEntity
 * @author 汉成
 * @version 2024-12-20
 */
@Table(name="dp_orderdetail", alias="a", label="dp_orderdetail信息", columns={
		@Column(name="id", attrName="id", label="id", isPK=true),
		@Column(name="orderid", attrName="orderid", label="订单ID"),
		@Column(name="ordertype", attrName="ordertype", label="订单类型"),
		@Column(name="typeid", attrName="typeid", label="商品ID"),
		@Column(name="title", attrName="title", label="商品名称", queryType=QueryType.LIKE),
		@Column(name="shuliang", attrName="shuliang", label="数量"),
		@Column(name="danjia", attrName="danjia", label="单价"),
		@Column(name="userno", attrName="userno", label="订单账号"),
		@Column(name="smallpic", attrName="smallpic", label="订单账号"),
	}, orderBy="a.id DESC"
)
public class DpOrderdetail extends DataEntity<DpOrderdetail> {
	
	private static final long serialVersionUID = 1L;
	private String orderid;		// 订单ID
	private String ordertype;		// 订单类型
	private String typeid;		// 商品ID
	private String title;		// 商品名称
	private Long shuliang;		// 数量
	private Double danjia;		// 单价
	private String userno;		// 订单账号
	private String smallpic;		
	public DpOrderdetail() {
		this(null);
	}
	
	public DpOrderdetail(String id){
		super(id);
	}
	
	@NotBlank(message="订单ID不能为空")
	@Size(min=0, max=36, message="订单ID长度不能超过 36 个字符")
	public String getOrderid() {
		return orderid;
	}

	public void setOrderid(String orderid) {
		this.orderid = orderid;
	}
	
	@NotBlank(message="订单类型不能为空")
	@Size(min=0, max=1, message="订单类型长度不能超过 1 个字符")
	public String getOrdertype() {
		return ordertype;
	}

	public void setOrdertype(String ordertype) {
		this.ordertype = ordertype;
	}
	
	@NotBlank(message="商品ID不能为空")
	@Size(min=0, max=36, message="商品ID长度不能超过 36 个字符")
	public String getTypeid() {
		return typeid;
	}

	public void setTypeid(String typeid) {
		this.typeid = typeid;
	}
	
	@NotBlank(message="商品名称不能为空")
	@Size(min=0, max=255, message="商品名称长度不能超过 255 个字符")
	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}
	
	@NotNull(message="数量不能为空")
	public Long getShuliang() {
		return shuliang;
	}

	public void setShuliang(Long shuliang) {
		this.shuliang = shuliang;
	}
	
	@NotNull(message="单价不能为空")
	public Double getDanjia() {
		return danjia;
	}

	public void setDanjia(Double danjia) {
		this.danjia = danjia;
	}
	
	@Size(min=0, max=255, message="订单账号长度不能超过 255 个字符")
	public String getUserno() {
		return userno;
	}

	public void setUserno(String userno) {
		this.userno = userno;
	}

	public String getSmallpic() {
		return smallpic;
	}

	public void setSmallpic(String smallpic) {
		this.smallpic = smallpic;
	}
	
}